\documentclass[tikz,border=2mm]{standalone}
\usepackage{array,amsmath,mathptmx,xcolor,bbding,pifont,colortbl}
\usepackage[UTF8]{ctex}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% 只需要这个就可以
\usepackage[thicklines]{cancel}

% 可以设置线条颜色，默认是黑色
\usepackage{xcolor}
\renewcommand{\CancelColor}{\color{red}} 
\usepackage{tikz-cd}
\usepackage{tikz,graphicx,subfig,caption} % Required for drawing custom shapes
\usetikzlibrary{fit,matrix,chains,arrows,shapes,positioning,arrows.meta,chains,shadows,shapes.callouts,decorations.text,shapes.symbols,shapes.misc, positioning,decorations.pathreplacing,calc}
\arrayrulecolor{red}
% 设置浅蓝色
\definecolor{lightblue1}{RGB}{175, 175, 237}
\definecolor{lightgreen1}{RGB}{226, 246, 186}
% 设定删除线颜色
\renewcommand{\CancelColor}{\color{red}}

\begin{document}
	\begin{tikzpicture}[>=latex,every node/.style={anchor=south west,,inner sep=0}]
		
		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
		\node[drop shadow, fill=white] at (5em,0) (SYNBL){
			\begin{tabular}[draw=red]{|l l|} \hline
				%  行1
				\color{blue}(1) & \color{blue}{开始:\hspace{1.5em}栈\hspace{3.5em}\hspace{0.5em};\hspace{0.5em} NEXT(w)}   \\   
				% 行2
				\color{blue}(2) & \color{blue}{重复执行 $\textcircled{1}$、$\textcircled{2}$、$\textcircled{3}$,直到栈中只剩\hspace{0.5em}}\color{red}{$\#$}\color{blue}{ 为止:} \\    
				% 行3
				& \color{blue}$\textcircled{1}$\hspace{1em}若 栈顶符号$=A$ \color{red} 且 \color{blue} 当前符 w=a \color{red} 且 \color{blue} 有\color{red}产生式\color{blue}: \\    
				% 行4
				& {\hspace{2em}\color{red}A$\rightarrow$$a\alpha$\color{blue},\hspace{1em}则 \hspace{0.5em}POP,PUSH$(a\alpha)^R$;} \\ 
				% 行5
				& \hspace{2em}\color{blue}即：栈调整：\hspace{3.7em}\color{lightgreen1}{\ding{225}}   \\    
				% 行6
				& \color{blue}$\textcircled{2}$\hspace{0.8em} 若 栈顶符$=a$ \color{red}且 \color{blue}当前符为$a$；则 pop,NEXT(w); \\  
				% 行7
				& \hspace{2em}\color{blue}即：栈调整：\hspace{3.5em} \color{lightgreen1}{\ding{225}}  \\    
				% 行8
				&\color{blue}$\textcircled{3}$\hspace{1em}否则，\color{red}错误处理\color{blue}! \\    
				% 行9
				\color{blue}(3) & \color{blue} 结束: 栈 \hspace{3.5em}；当前符$w=$\color{red}$\#$  \\ \hline
			\end{tabular}
		};
		% 第一行字
		\node (title1) at ([xshift=-12.5em,yshift=0.3em]SYNBL.north) {    \color{black}{\SparkleBold\hspace{0.5em}设有文法}\color{blue}{G(Z), }\color{red}{$\#$}\color{blue}{ 栈底标记}\color{black}{和}\color{blue}{结束标记;} };
		
		%  逆序压栈
		\node(a2)[draw, draw=blue, fill=yellow!20,line width=0.05em, rectangle callout, callout relative pointer={(-2.8,0.1)}, rounded corners, align=center ,inner sep=0.3em] at ([xshift=-0.7em, yshift=0em]SYNBL.east) {\color{red}逆序 \\ \color{red}压栈};
		
		% 第一行的方框
		\node (node-1) at ([xshift=-4.5em,yshift=-1.03em]SYNBL.north){\color{red}$\#$\color{blue}{Z\hspace{1em}\hspace{1em}}};
		%  黑色方框
		\node [draw=black, rectangle, inner sep=0.2em,line width=0.025em][fit=(node-1)](box1){};
		
		% 第5行的方框1
		\node (node-5-1) at ([xshift=-2.3em,yshift=-5.7em]SYNBL.north){\color{red}$\#$\color{blue}$...$\bcancel{\small{A}}\hspace{1em}\hspace{1em}};
		%  黑色方框
		\node [draw=black, rectangle, inner sep=0.2em,line width=0.0025em][fit=(node-5-1)](box2){};
		
		% 第5行的方框2
		\node (node-5-2) at ([xshift=3em,yshift=-5.7em]SYNBL.north){\color{red}$\#$\color{blue}$...\alpha a$\hspace{1em}\hspace{1em}};
		%  黑色方框
		\node [draw=black, rectangle, inner sep=0.2em,line width=0.025em][fit=(node-5-2)](box3){};
		
		% 第7行的方框1
		\node (node-7-1) at ([xshift=-2.3em,yshift=-8em]SYNBL.north){\color{red}$\#$\color{blue}$...$\bcancel{a}\hspace{1em}\hspace{1em}};
		%  黑色方框
		\node [draw=black, rectangle, inner sep=0.2em,line width=0.0025em][fit=(node-7-1)](box4){};
		
		% 第7行的方框2
		\node (node-7-2) at ([xshift=3em,yshift=-8em]SYNBL.north){\color{red}$\#$\color{blue}$...$\hspace{1em}\hspace{1em}};
		%  黑色方框
		\node [draw=black, rectangle, inner sep=0.2em,line width=0.025em][fit=(node-7-2)](box5){};
		
		% 第9行的方框
		\node (node-9) at ([xshift=-5.5em,yshift=-10.4em]SYNBL.north){\color{red}$\#$\hspace{1.5em}\hspace{1.5em}};
		%  黑色方框
		\node [draw=black, rectangle, inner sep=0.2em,line width=0.0025em][fit=(node-9)](box6){};
		
	\end{tikzpicture}
\end{document}